package com.hmkj.core.mapper.strategy;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.po.strategy.StrategyRank;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 策略排行相关Dao接口<br>
 *
 * @author eproo
 * @date   2018-07-09 03:29:31
 */
public interface StrategyRankMapper extends GenericMapper<StrategyRank,Integer> {

    /**
     * 策略排行
     */
    @Select("SELECT * FROM s_strategy_rank WHERE 1=1 and status = #{status} and del_flag = 1 order by stock_num desc ")
    List<StrategyRank> selectStrategyRank(@Param(value = "status") Integer status);

    @Select("SELECT t.* FROM s_strategy_rank t WHERE 1=1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize} ")
    List<StrategyRank> findListBySqlJoin(Map<String, Object> params);

    @Select("SELECT count(1) FROM s_strategy_rank t WHERE 1=1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);
}
